<template>
  <div class="timetable">
    <!-- 标题 -->
    <div class="title">
      <span @click="$router.go(-1)"><van-icon name="arrow-left" /></span>
      <span style="font-weight: 600">课程表</span>
      <span>今天</span>
    </div>
    <van-cell title="点这里" :value="date" @click="show = true" />
    <van-calendar v-model:show="show" @confirm="onConfirm" />
    <img style="width: 200px;height: 200px;line-height: 200px;text-align: center;margin-left: 100px;
    margin-top: 100px;" src="../assets/宜复习.png" alt="">
  </div>
</template>

<script>
import { ref } from "vue";
export default {
  setup() {
    const date = ref("");
    const show = ref(false);

    const formatDate = (date) => `${date.getMonth() + 1}/${date.getDate()}`;
    const onConfirm = (value) => {
      show.value = false;
      date.value = formatDate(value);
    };

    return {
      date,
      show,
      onConfirm,
    };
  },
};
</script>
<style lang="scss" scoped>
.timetable {
  font-size: 20px;
  width: 100%;
  font-family: PingFangSC-Regular;
}
.title {
  background: #fff;
  display: flex;
  padding: 19px;

  justify-content: space-between;
  align-items: center;
  font-size: 20px;
  margin-bottom: 20px;
}
</style>